home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Magazine Collection 2001
/
Delphi Magazine Collection 20001 (2001).iso
/
DISKS
/
ISSUE18
/
SURVIVE
/
FMLOGIN.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-12-06
|
1KB
|
72 lines
unit fmLogin;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons, ExtCtrls;
type
TdlgLogin = class(TForm)
btnOK: TButton;
btnCancel: TButton;
Label1: TLabel;
Label2: TLabel;
edtUsername: TEdit;
edtPassword: TEdit;
Image1: TImage;
cboServerDatabase: TComboBox;
Label3: TLabel;
private
public
end;
function LaunchLoginDialog(
var Username,
Password,
Server,
Database: string): TModalResult;
var
dlgLogin: TdlgLogin;
implementation
{$R *.DFM}
function LaunchLoginDialog(
var Username,
Password,
Server,
Database: string): TModalResult;
var
SDText: string;
I: Integer;
begin
Application.CreateForm(TdlgLogin, dlgLogin);
try
with dlgLogin do
begin
cboServerDatabase.ItemIndex := 0;
Result := ShowModal;
if Result = mrOK then
begin
Username := edtUsername.Text;
Password := edtPassword.Text;
Server := '';
Database := '';
if cboServerDatabase.ItemIndex > 0 then
begin
SDText := cboServerDatabase.Text;
I := Pos('\', SDText);
Server := Copy(SDText, 1, I - 1);
Database := Copy(SDText, I + 1, Length(SDText));
end;
end;
end;
finally
dlgLogin.Release;
end;
end;
end.